Made quite some changes