algorithm basic bugs fixed