speed working. need to fix function and add array to get function