horrible implementation still horrible but better