Ye dw, this code is just plain bad.