moved f/w selection to design, edited code with comments
moved f/w selection to design, edited code with comments