v4.1 General cleanup of code, fixed several bugs in GUI, added javadocs