added new features, further testing is required.