Cleaned up a bit more. Currently being tested