Moar tests

Also updated midpoint function. Still not working completely will finish
later.