Cleaned up code and interface