trying to optimize all this shit