ugly code for silly lab exercises