finished chapter3 from rails tutorial