Bad code form, but everything works