Completed tests, removed some redundant code