Some changed made for better performance

this is not 100% finished!