done some code cleanup and added comments
import of my reworked version of justins code merged f10's frontend (some work nescessary)