some methods added, structure improved