changed filter layout
added layout
added a lot of comments for the codes