updated render and clear methods