WORKING CODE, ugly but plays