Cleaned up a bit, removed usage of double