Cleaned up code a bit. Removed unused (and confusing) methods