changed some code positioning