Final solution can be found HERE