working version before leaving because of mafil maniak