cleaned up a little, added more comments.
Added more commenting, removed matlab script from main