more functions
finally merged
merged and restyled