fix app signature
utility functions
factor out arr-second, right for efficiency