some stupid functions for UI, don't read this code please