First version. Deals with really basic cases