cleaned code, fixed tabletop issue