preliminary bugs fixed