Added some additional functionallity +corrected some earlyier mistakes