Move code to the correct project, fixed formatting; and fix code