Cleaned up interface, fixed some bugs, changed replace name