various improvements, fixed one bug about rendering