moved for easier reading
moved answer code for easier reading