some new changes to the code and ui by Thomas Thomsen