changed sun functions