bugs fixed. Tests performed