Changed code as I should