Further improvements, added new functionality