worked version 1

However it does not seem to be what the assignment wanted