Added comments, tidied up
Update unit test now that border is treated better