Finaly layout. Fixed bugs, create quaries