Just did this for practice by memory. Hope it's correct