moving code to right location