Added a bit of bottom edge detection, still needs work