adjusted parameters, replaced some code parts wit equivalent, faster expressions