bugs fixed (incomplete)