added warning to code
spaghetti, anyone?