working on some speed improvements