renamed original file, cleaned up code for v2.