Refactoring sandSpent

Might be a bit 'unclean', but it gets the job done.