FInal version, all four tests passing