Removed some unneccesary complications with algebra