Working version of basic version before loops