code fixed to get tests passed