Adapted sun to new conventions and some tweaks