fixed layout and moved to sqlite db