Completed issue#39

Also Completed issue#40