cleaning up Matlab further