added both solutions
fixed merge