finished logic - bugs somewhere...