Working on max but still buggy