some bugs fixed. trying first commit